﻿package cn.hadron.aa.action.admin;
import java.util.Map;

import cn.hadron.aa.entity.User;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class Authority extends AbstractInterceptor{
	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		ActionContext context=invocation.getInvocationContext();
		Map session=context.getSession();
		User admin=(User)session.get("admin");
		if(admin!=null)
			return invocation.invoke();
		context.put("message", "您还没有登录！");
		return Action.LOGIN;
	}
}